package cn.hy.考试;

import java.util.Arrays;

/**
 *
 * 2 3 6 5 7 3 6
 *
 */
public class Test02 {


    public static void main(String[] args) {

        int [] arr = new int[] {2,3,6, 5, 7, 3, 6};
        bubbleSort(arr);
        System.out.println(Arrays.toString(arr));
    }


    public static void bubbleSort(int[] arr) {
        if (arr == null || arr.length == 0 ) {
            return;
        }
        for (int i = 0; i < arr.length -1 ; i++) {
            for (int j = i + 1 ; j < arr.length; j++) {
                 if (arr[i] > arr[j]) {
                     int temp = arr[i];
                     arr[i] = arr[j];
                     arr[j] = temp;
                 }
            }
        }
    }




}
